﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
using System.Data;
using System.Data.SqlClient;

namespace DAO
{
    public partial class PhieuNhap_DAO
    {
        PhieuNhap_DAO pn_dao;
        public bool ThemPhieuNhap(PhieuNhap phieunhap_dto)
        {
            DataProvider dp = new DataProvider();
            SqlParameter[] Parameter = new SqlParameter[3];

            Parameter[0] = new SqlParameter("@MaPN", phieunhap_dto.MaPhieuNhap);
            Parameter[1] = new SqlParameter("@NgayLap", phieunhap_dto.NgayLap);
            Parameter[2] = new SqlParameter("@MaNV", phieunhap_dto.MaNV);
            return dp.ExecutenonQuery("sp_ThemPhieuNhap", Parameter);
        }
        public string MaPNTang()
        {
            DataProvider dp = new DataProvider();
            DataTable dt = new DataTable();

            dt = dp.ExecuteQuery("sp_MaPN_Tang");
            return dt.Rows[0][0].ToString();
        }
    }
}
